#pragma once

#include <AVUIContentControl.h>

namespace AVUI {
class RoutedCommand;
class RequestNavigateEventArgs;
class Uri;
class IClientNavResult;

class Frame : public ContentControl
{
public:
    Frame();
    ~Frame();

    DECLARE_ELEMENT(Frame, ContentControl);


    DECLARE_DEPENDENCY_PROPERTY(Source);
    TRefCountedPtr<Uri> get_Source() { return (Uri*)GetValue(get_SourceProperty()).get_Ptr(); }
    void set_Source(Uri* pValue) { SetValue(get_SourceProperty(), (Object*) pValue); }

    void Navigate(Uri* pNavTo);

private:
    static void StaticConstructor();
    static void SourcePropertyChanged(DependencyObject* pDO, DependencyPropertyChangedEventArgs* e);
    void OnNavigationCompleted(Object* pSender, EventArgs* pArgs);
    void Frame::CleanupNavResult();

    IClientNavResult* m_pNavResult;
};


}; // namespace AVUI
